ig.module(
	'game.entities.base.baseGhost'
)
.requires(
	'impact.entity',
        'game.entities.base.pickableType',
        'game.entities.base.pickObject'	
)
.defines(function()
{
    EntityBaseGhost = EntityPickObject.extend(
    {
        size: {x:16, y:20},  	
        animSheet: new ig.AnimationSheet('media/images/blueGhost.png', 16, 20),
	collides: ig.Entity.COLLIDES.ACTIVE,	        
	pickType: 'greenGhost',
	subPickType: 'ghost',	
	pickable: false,        
	
	init: function(x, y, settings)
	{
	    this.parent(x, y, settings);
	},
	
	touches: function(other)
	{
	    var isTouched = this.parent(other);
	    
            if (other instanceof EntityPlayer)
            {                
                if (isTouched == true && this.picked == false)
		{
		    ig.global.touched++;		    
		    this.onPick();
		}
		else if (this.picked == true)
		{
		    this.kill();
		}		
            }
            
            return isTouched;  
	},
	
	update: function()
	{
	    this.parent();
	    
	    if (this.vel.x > 0)
	    {
		this.currentAnim.flip.x = true;
	    }
	    else if (this.vel.x < 0)
	    {
		this.currentAnim.flip.x = false;		
	    }
	},
	
	draw: function()
	{
	    this.parent();
	}	
    });
});